package 抽象工厂模式;

public class ShapeFactory implements MaxFactory{

    @Override
    public Color getColor(Class colorType) {
        return null;
    }

    public Shape getShape(Class shapeType) {
        if (shapeType ==null){
            return null;
        }
        if (shapeType.getTypeName().equals("抽象工厂模式.Circle")) {
            return new Circle();
        } else if (shapeType.getTypeName().equals("抽象工厂模式.Rectangle")) {
            return new Rectangle();
        } else if (shapeType.getTypeName().equals("抽象工厂模式.Square")) {
            return new Square();
        } else {
            return null;
        }
    }
}
